import bus from "@/bus";
import { renderButton } from '@/util';
let data = {
  status: 'pass',
  totalItem: 21,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    keyword: ''
  },
  columns: [{
      title: '合同名称',
      key: 'name',
      align: 'left',
      minWidth: 200,
      tooltip: true
    }, {
      title: '合同编号',
      key: 'sn',
      align: 'left',
      minWidth: 200
    },
    {
      title: '预签开始',
      key: 'preStartDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '预签结束',
      key: 'preEndDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '合同开始',
      key: 'startDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '合同结束',
      key: 'endDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '创建时间',
      key: 'createDate',
      align: 'left',
      minWidth: 200
    },
    {
      title: '适用门店',
      key: 'storeTypeName',
      align: 'left',
      minWidth: 200
    },
    {
      title: '状态',
      key: 'status',
      align: 'left',
      minWidth: 100,
      render: (h, params) => {
        let p = {0: '待生效', 1: '生效', 2: '失效'}
        return <span>{p[params.row.status]}</span>
      }
    },
    {
      title: '操作',
      align: 'right',
      minWidth: 200,
      render: (h, params) => {
        return (
          <div>
            { renderButton(h, { text: '查看',},
              ()=>{ bus.$emit("onDetail",  params.row)})}
            { renderButton(h, { text: '编辑', type: 'primary',},
              ()=>{ bus.$emit("onEdit", params.row)})}
          </div>
        )
      }
    }
  ],
  data: []
}
export default data;
